package com.dacd.soundanalysis.activity

import android.os.Bundle
import android.os.Handler
import android.os.Message
import android.support.v7.app.AppCompatActivity
import java.lang.ref.WeakReference

class SplashActivity : AppCompatActivity() {

    companion object {
        private const val TO_LOGIN = 0

        private class WithoutLeakHandler(activity: SplashActivity) : Handler() {
            private val mActivity: WeakReference<SplashActivity> = WeakReference(activity)

            override fun handleMessage(msg: Message?) {
                val activity = mActivity.get() ?: return
                when (msg!!.what) {
                    TO_LOGIN -> {//跳转到登录界面

                    }
                }
            }
        }
    }

    private val handler: Handler = Companion.WithoutLeakHandler(this)

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        handler.sendEmptyMessage(TO_LOGIN)
    }
}